package com.yunhai.xc.common.summernote;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import com.yunhai.xc.common.UploadUtil;

@Component
@RequestMapping("/common")
public class SummerController {
	@RequestMapping("/summernote")
	@ResponseBody
	public Map<String, Object> summernote(MultipartFile file) throws Exception {
		String host = "http://123.249.94.102:/upload/image/";
		String path = UploadUtil.uploadFile(file);
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("path", host + path);
		return map;
	}
}
